<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	template="/templates/mainTemplate.xhtml">



	<ui:define name="windowTitle">
            #{msgs.loginTitle}
         </ui:define>
	<ui:define id="newTask" name="content">


		<h:form>
			<h:panelGrid columns="2">
				<h:outputText value="Nazwa tasku" />
				<h:inputText value="#{newTasktBean.taskName}"
					style="font-size: 14px; font-style:oblique; width: 100%" />

				<h:outputLabel styleClass="textStyle" value="Opis tasku:" />
				<h:inputTextarea
					style="resize: none; font-size: 14px; font-style:oblique"
					id="projectDesc" rows="5" cols="75"
					value="#{newTasktBean.taskDescription}" />
				<h:outputLabel styleClass="textStyle" value="Kontekst:" />
				<h:selectOneListbox value="#{newTasktBean.contextName}">
					<f:selectItems value="#{newTasktBean.allContextMap}" />
				</h:selectOneListbox>
				<h:outputLabel rendered="#{newTasktBean.projectOwner}" styleClass="textStyle" value="Użytkownik:" />
				<h:selectOneListbox size="5" rendered="#{newTasktBean.projectOwner}" value="#{newTasktBean.ownerName}">
					<f:selectItems value="#{newTasktBean.allUsersMap}" />
				</h:selectOneListbox>
				<h:outputLabel styleClass="textStyle" value="Dodaj załącznik:" />
				<h:panelGrid columns="2" columnClasses="top,top">
					<rich:fileUpload style="width: 480px" acceptedTypes="jpg,pdf,jpeg,txt,xls" addLabel="Dodaj załącznik" uploadLabel="Zapisz na dysku" noDuplicate="true" 
						fileUploadListener="#{fileUploadBean.listener}" id="upload">
					</rich:fileUpload>
				</h:panelGrid>
			</h:panelGrid>

			<h:panelGroup style="display:block; text-align:center; margin: 10px">
				<h:commandButton action="#{newTasktBean.saveTask(fileUploadBean)}" value="Zapisz" />
				<h:commandButton action="#{newTasktBean.cancelAddTask(fileUploadBean)}"
					value="Anuluj" />
			</h:panelGroup>

		</h:form>
	</ui:define>

</ui:composition>